#include <iostream>
using namespace std;
typedef long long ll;

int main() {
    ll n, m;
    cin >> n >> m;
    // 计算正方形的数量
    ll square = 0;
    for (int i = 1; i <= min(n, m); i++)
        square += (n - i + 1) * (m - i + 1);
    // 计算矩形（包含正方形）的总数。在n+1条边中选取两条线作为矩形的上下边界，在m+1条边中选取两条线作为矩形的左右边界。
    ll total = (n * (n + 1) / 2) * (m * (m + 1) / 2);
    ll rectangle = total - square;
    cout << square << " " << rectangle << endl;

    return 0;
}